package classt;

class Animal{
    private  int val;

    public void breath(int val){
        this.val = val;
        System.out.println("Animal breath running......");
        System.out.println("val = "+ this.val);
    }
};

class Bird{
    private Animal animal;

    public Bird(Animal animal){
        this.animal = animal;
    }

    public void breath(int val){
        animal.breath(val);
    }

    public void flay(){
        System.out.println("I can fly");
    }
};

class Wolf{
    private Animal animal;

    public  Wolf(Animal animal){
        this.animal = animal;
    }

    public void breath(int val){
        animal.breath(val);
    }

    public void run(){
        System.out.println("I can run");
    }
};


public class struct {

    public static void main(String[] args){
        System.out.println("main running");

        Animal animal = new Animal();

        Bird bird = new Bird(animal);
        Wolf wolf = new Wolf(animal);

        bird.breath(32);
        bird.flay();

        wolf.breath(23);
        wolf.run();
    }
}
